<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
    <!--使用局部组件-->
    <login></login>
</div>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script>
    let login = {
        template: "<div><h1>欢迎，{{name}}</h1></div>",
        //组件内数据(必须为一个函数)
        data() {
            return {
                name:"yaya"
            }
        }
    }
    const app = new Vue({
        el: "#app",
        data: {},
        methods: {},
        //在components中注册局部组件
        components: {
            login: login
        }
    })
</script>
</body>
</html>